package com.example.jianzhioffer;

/**
 * Created by Quincy on 2018/10/6.
 */
public class ReOrderArray {
    public void reOrderArray(int [] array) {
        if (array == null || array.length == 0)
            return;
        int temp = 0;
        for (int i = 0, j = 0; i < array.length && j < array.length; i++){
            if (array[i] % 2 != 0){
                temp = array[i];
                for (int k = i; k > j; k--)
                    array[k] = array[k - 1];
                array[j] = temp;
                j++;
            }

        }
    }
}
